<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //新建一个构造函数
        var name = "马化腾"
        function Person(name,age){
            this.name = name;
            this.age = age;
        }
        Person.prototype.sayName=function(){
            console.log(this.name);
        }
        var bb = new Person("马云",56);
        console.log(bb);
        console.log(bb.__proto__);
        console.log(Person.prototype);
        //Person.prototype==bb.__proto__

        bb.sayName();
        //首先先看构造函数里面有没有sayName方法，没有就去__proto__原型里面看有没有，没有就在进入下一层级__proto__原型看有没有
    </script>
</body>
</html>